<template>
  <div style="display: inline">
    <el-button @click="forgetIgnore" type="info">{{$t('order.forgetIgnoreBtn')}}</el-button>
  </div>
</template>

<script>
import {forgetIgnore} from "@/api/order";

export default {
  name: "ForgetIgnore",
  props:{
    orderId:{
      type: String,
      required: true,
    },
    accountTypeNum:{
      type: Number,
      required: true,
    }
  },
  methods:{
    forgetIgnore(){
      this.$confirm('', this.$t('order.forgetIgnoreTitle'), {
        dangerouslyUseHTMLString: true,
        confirmButtonText: this.$t('common.confirm'),
        cancelButtonClass: this.$t('common.forgetIgnoreTitle')
      })
        .then(res=>{
          const params = {
            orderId: this.orderId,
            accountTypeNum: this.accountTypeNum,
          }
          forgetIgnore(params)
            .then(res=>{
              if(res.error === 0){
                this.$successMessage(res.message)
                this.$emit('changeOrder',true)
              }else{
                this.$errorMessage(res.message)
              }
            })
        })
        .catch(res=>{
          // 点击了取消
        });
    }
  }
}
</script>

<style scoped>

</style>
